home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / SAMPLES.BIN / Emblaze.java < prev    next >
Encoding:
Java Source  |  1996-12-03  |  3.6 KB  |  166 lines

  1. /*
  2.     A basic extension of the java.awt.Frame class
  3.  */
  4.  
  5. import java.awt.*;
  6. import symantec.itools.multimedia.SoundPlayer;
  7.  
  8. public class Emblaze extends Frame {
  9.     void button1_Clicked(Event event) {
  10.  
  11.  
  12.         //{{CONNECTION
  13.         // Start the animation
  14.         {
  15.             emblaze201.start();
  16.         }
  17.         //}}
  18.  
  19.         //{{CONNECTION
  20.         // Start the sound player
  21.         {
  22.             soundPlayer1.play();
  23.         }
  24.         //}}
  25.     }
  26.  
  27.     void previousimage_Clicked(Event event) {
  28.  
  29.  
  30.         //{{CONNECTION
  31.         // Start the animation
  32.         {
  33.             emblaze201.start();
  34.         }
  35.         //}}
  36.  
  37.         //{{CONNECTION
  38.         // Resume the animation
  39.         {
  40.             emblaze201.unfreeze();
  41.         }
  42.         //}}
  43.  
  44.         //{{CONNECTION
  45.         // Enable the Emblaze20
  46.         emblaze201.enable();
  47.         //}}
  48.     }
  49.  
  50.     void nextimage_Clicked(Event event) {
  51.  
  52.  
  53.         //{{CONNECTION
  54.         // Pause the animation
  55.         {
  56.             emblaze201.freeze();
  57.         }
  58.         //}}
  59.     }
  60.  
  61.     void close_Clicked(Event event) {
  62.  
  63.  
  64.         //{{CONNECTION
  65.         // Pause the animation
  66.         {
  67.             emblaze201.freeze();
  68.         }
  69.         //}}
  70.  
  71.         //{{CONNECTION
  72.         // Hide the Frame
  73.         hide();
  74.         //}}
  75.     }
  76.  
  77.  
  78.     public Emblaze() {
  79.  
  80.         //{{INIT_CONTROLS
  81.         setLayout(null);
  82.         addNotify();
  83.         resize(insets().left + insets().right + 477,insets().top + insets().bottom + 388);
  84.         emblaze201 = new geo.emblaze.Emblaze20();
  85.         emblaze201.reshape(insets().left + 79,insets().top + 23,346,276);
  86.         add(emblaze201);
  87.         try {
  88.             emblaze201.setFileURL(symantec.itools.net.RelativeURL.getURL("blaze/symantec.blz"));
  89.         } catch (java.net.MalformedURLException error) {
  90.         }
  91.         nextimage = new java.awt.Button("Pause the Video");
  92.         nextimage.reshape(insets().left + 171,insets().top + 354,138,24);
  93.         add(nextimage);
  94.         previousimage = new java.awt.Button("Resume playing Video");
  95.         previousimage.reshape(insets().left + 313,insets().top + 354,138,24);
  96.         add(previousimage);
  97.         close = new java.awt.Button("Close");
  98.         close.reshape(insets().left + 28,insets().top + 354,138,24);
  99.         add(close);
  100.         button1 = new java.awt.Button("Start the Video");
  101.         button1.reshape(insets().left + 170,insets().top + 321,138,24);
  102.         add(button1);
  103.         soundPlayer1 = new symantec.itools.multimedia.SoundPlayer();
  104.         soundPlayer1.setSyncMode(true);
  105.         soundPlayer1.setRepeat(2);
  106.         try {
  107.             java.net.URL[] tempURL = new java.net.URL[1];
  108.             tempURL[0] = symantec.itools.net.RelativeURL.getURL("sounds/T2.au");
  109.             soundPlayer1.setURLList(tempURL);
  110.         } catch (java.net.MalformedURLException error) {
  111.         }
  112.         //$$ soundPlayer1.move(7,346);
  113.         setTitle("Untitled");
  114.         //}}
  115.  
  116.         //{{INIT_MENUS
  117.         //}}
  118.     }
  119.  
  120.     public Emblaze(String title) {
  121.         this();
  122.         setTitle(title);
  123.     }
  124.  
  125.     public synchronized void show() {
  126.         move(50, 50);
  127.         super.show();
  128.     }
  129.  
  130.     public boolean handleEvent(Event event) {
  131.         if (event.id == Event.WINDOW_DESTROY) {
  132.             hide();         // hide the Frame
  133.             return true;
  134.         }
  135.         if (event.target == close && event.id == Event.ACTION_EVENT) {
  136.             close_Clicked(event);
  137.             return true;
  138.         }
  139.         if (event.target == nextimage && event.id == Event.ACTION_EVENT) {
  140.             nextimage_Clicked(event);
  141.             return true;
  142.         }
  143.         if (event.target == previousimage && event.id == Event.ACTION_EVENT) {
  144.             previousimage_Clicked(event);
  145.             return true;
  146.         }
  147.         if (event.target == button1 && event.id == Event.ACTION_EVENT) {
  148.             button1_Clicked(event);
  149.             return true;
  150.         }
  151.         return super.handleEvent(event);
  152.     }
  153.  
  154.     //{{DECLARE_CONTROLS
  155.     geo.emblaze.Emblaze20 emblaze201;
  156.     java.awt.Button nextimage;
  157.     java.awt.Button previousimage;
  158.     java.awt.Button close;
  159.     java.awt.Button button1;
  160.     symantec.itools.multimedia.SoundPlayer soundPlayer1;
  161.     //}}
  162.  
  163.     //{{DECLARE_MENUS
  164.     //}}
  165. }
  166.